package com.ktgj.customer.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.customer.mapper.MallProductSupplierMapper;
import com.ktgj.customer.domain.MallProductSupplier;
import com.ktgj.customer.service.IMallProductSupplierService;

/**
 * 商城商品供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-30
 */
@Service
public class MallProductSupplierServiceImpl implements IMallProductSupplierService 
{
    @Autowired
    private MallProductSupplierMapper mallProductSupplierMapper;

    /**
     * 查询商城商品供应商
     * 
     * @param id 商城商品供应商ID
     * @return 商城商品供应商
     */
    @Override
    public MallProductSupplier selectMallProductSupplierById(Long id)
    {
        return mallProductSupplierMapper.selectMallProductSupplierById(id);
    }

    /**
     * 查询商城商品供应商列表
     * 
     * @param mallProductSupplier 商城商品供应商
     * @return 商城商品供应商
     */
    @Override
    public List<MallProductSupplier> selectMallProductSupplierList(MallProductSupplier mallProductSupplier)
    {
        return mallProductSupplierMapper.selectMallProductSupplierList(mallProductSupplier);
    }

    /**
     * 新增商城商品供应商
     * 
     * @param mallProductSupplier 商城商品供应商
     * @return 结果
     */
    @Override
    public int insertMallProductSupplier(MallProductSupplier mallProductSupplier)
    {
        mallProductSupplier.setCreateTime(DateUtils.getNowDate());
        return mallProductSupplierMapper.insertMallProductSupplier(mallProductSupplier);
    }

    /**
     * 修改商城商品供应商
     * 
     * @param mallProductSupplier 商城商品供应商
     * @return 结果
     */
    @Override
    public int updateMallProductSupplier(MallProductSupplier mallProductSupplier)
    {
        return mallProductSupplierMapper.updateMallProductSupplier(mallProductSupplier);
    }

    /**
     * 批量删除商城商品供应商
     * 
     * @param ids 需要删除的商城商品供应商ID
     * @return 结果
     */
    @Override
    public int deleteMallProductSupplierByIds(Long[] ids)
    {
        return mallProductSupplierMapper.deleteMallProductSupplierByIds(ids);
    }

    /**
     * 删除商城商品供应商信息
     * 
     * @param id 商城商品供应商ID
     * @return 结果
     */
    @Override
    public int deleteMallProductSupplierById(Long id)
    {
        return mallProductSupplierMapper.deleteMallProductSupplierById(id);
    }
}
